summaryrefslogtreecommitdiff
path: root/examples/container-with-vitest/test/[locale].test.ts
blob: db450df538d35b654a855fcd5559a33eb0bbb270 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
import { expect, test } from 'vitest';
import Locale from '../src/pages/[locale].astro';

test('Dynamic route', async () => {
	const container = await AstroContainer.create();
	// @ts-ignore
	const result = await container.renderToString(Locale, {
		params: {
			locale: 'en',
		},
		request: new Request('http://example.com/en'),
	});

	expect(result).toContain('Locale: en');
});